-- Leviathan (c) v.v.balashoff
local Class = require('leviathan/Class')

local FadeSystem = Class:derive('UIFadeSystem')

function FadeSystem:new(domain)
    self.name = 'FadeSystem'
    self.domain = domain
end

function FadeSystem:update(dt)
    local r = self.domain.components['Fade']
    if r then
        for _, c in pairs(r) do
            if c.id == 'FadeComponent' then
                if c.enabled then
                    c.tween:update(dt)
                end
            end
        end
    end
end

return FadeSystem
